package org.dtrd.modules.content.tags.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.content.tags.entity.bean.TagDetail;

import java.util.Date;


/**
 * <p>
 * 标签表
 * </p>
 *
 * @author QR
 * @since 2022-03-08
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_tag")
public class DtrdEntRdTag {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 标签名字
     */
    @TableField("tag_name")
    private String tagName;

    @TableField("create_time")
    private Date createTime;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    public DtrdEntRdTag init() {
        createTime = new Date();
        isDel = 0;
        return this;
    }

    public DtrdEntRdTag parseFromDTO(TagDetail dto) {
        dataId = dto.getTagId();
        tagName = dto.getTagName();
        return this;
    }


}
